package com.zxjia.ssmp.controller;

import com.zxjia.ssmp.api.ProductApiService;
import com.zxjia.ssmp.dto.CartRequest;
import com.zxjia.ssmp.vo.ResultVO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "购物车管理")
@Controller
@RequestMapping(value = "/api")
public class CartController {

    @Autowired
    ProductApiService productApiService;

    @PostMapping(value = "/cart/addCart")
    public ResultVO addCart(CartRequest request) {
        return ResultVO.success(productApiService.addCart(request));
    }

}
